package com.example.tushu.Service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.tushu.Mapper.LoanMapper;
import com.example.tushu.Pojo.Loan;
import com.example.tushu.Service.LoanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LoanServiceImpl extends ServiceImpl<LoanMapper,Loan> implements LoanService {
    @Autowired
    LoanMapper loanMapper;

    @Override
    public IPage<Loan> page(long current,long size) {
        Page<Loan> page=new Page<>(current,size);
//        QueryWrapper<Loan> wrapper=new QueryWrapper<>();
        return loanMapper.getPage(page);
    }

    @Override
    public List<Loan> find(String username, String bookname, String status, String startTime, String endTime) {
        return loanMapper.find(username,bookname,status,startTime,endTime);
    }

}
